<template lang="pug">
  .header 
    .header-con
      img(src='../../assets/images/logo.png',alt='logo',@click='homeRoute')
      headerUser
</template>

<script>
import headerUser from './components/HeaderUser'

export default {
  name: 'Header',
  components: { headerUser },
  methods: {
    homeRoute() {
      let homePage = ''
      if (JSON.parse(sessionStorage.getItem('routes'))[0].path === '') {
        homePage = JSON.parse(sessionStorage.getItem('routes'))[0].children[0].path
      } else {
        homePage = `${JSON.parse(sessionStorage.getItem('routes'))[0].path}/${JSON.parse(sessionStorage.getItem('routes'))[0].children[0].path}`
      }
      this.$router.push(`${homePage}`)
    }
  }
}
</script>

<style lang="scss">
@import './index.scss';
</style>

